Help with rich text / string formatting

Hi - I have a DXL attr where I'm trying to summarise what's changed in this version. For each object, this loops through all ModifyObject history records, to compare the value before it was first changed with its current value (stores attribute name and value before change in an array).

However, it looks like history value (h.oldValue) is coming out with all rich text tags intact, whereas current (obj.attrname) is not. The comparison is then treating those rich text tags as if they were text.

I'm not sure where I am handling strings incorrectly (they also have to be stored in an array , and placed in buffers to compare) or if I have to explicitly strip rich text markup (no idea how to do that).

Any help much appreciated! (or any ideas on easier ways to prepare this summary - whichi, it seems to me, should be native to Doors...)
kierant - Mon Mar 29 04:51:42 EDT 2010

Re: Help with rich text / string formatting
Peter_Albert - Mon Mar 29 05:28:11 EDT 2010

See this Thread on how to get plain text out of the history. The secret is

string oldV = h.plainOldValue
string newV = h.plainNewValue

.

For the records: richText(current Object) (and the corresponding richTextWithOle, richTextNoOle) give you the full rich text versions of the current attribute vlue. You can than loop through the rich Text using the "for <RichTextParagraph> in <string> do" and "for <RichText> in <RichTextParagraph> do" loops and could do a coparison with the rich text history values. (Highly not recommended, though).

Regards,

Peter

Re: Help with rich text / string formatting
Peter_Albert - Mon Mar 29 05:30:02 EDT 2010

Peter_Albert - Mon Mar 29 05:28:11 EDT 2010

See this Thread on how to get plain text out of the history. The secret is

string oldV = h.plainOldValue
string newV = h.plainNewValue

.

For the records: richText(current Object) (and the corresponding richTextWithOle, richTextNoOle) give you the full rich text versions of the current attribute vlue. You can than loop through the rich Text using the "for <RichTextParagraph> in <string> do" and "for <RichText> in <RichTextParagraph> do" loops and could do a coparison with the rich text history values. (Highly not recommended, though).

Regards,

Peter

Sorry, this is the correct link.

Re: Help with rich text / string formatting
kierant - Mon Mar 29 06:11:33 EDT 2010

Peter_Albert - Mon Mar 29 05:30:02 EDT 2010
Sorry, this is the correct link.

Many thanks Peter, that did the trick (and I'd never have spotted that...).

I also had to make some changes so that the (valid) RTF markers were not rendered as text, namely:
obj.attrDXLName = richText result